FROM 10.126.56.21:5000/base-tomcat-maven:1.1

ADD pom.xml /tmp/build/

ADD front /tmp/build/front

ADD src /tmp/build/src

RUN cd /tmp/build && mvn -q dependency:resolve

RUN cd /tmp/build && mvn -q -DskipTests=true package \
        && rm -rf $CATALINA_HOME/webapps/* \
        && mv target/*.war $CATALINA_HOME/webapps/ROOT.war \
        && cd / && rm -rf /tmp/build

EXPOSE 8080

CMD ["catalina.sh","run"]